SET QUOTED_IDENTIFIER ON
GO
SET ANSI_NULLS ON
GO

 
 
 
 
 
 
 CREATE VIEW [dbo].[VALCOM_SSB_CUSIP_Map] AS
   
 
 SELECT DISTINCT i.extid   AS FS_ID
               , ssr.CUSIP AS SSB_ID
 
 FROM            FSFundModel_VALCOMM.dbo.StateStreetRecon ssr
                 
                 
                 INNER JOIN FSFundModel_VALCOMM.Reporting.AssetIdentifier ai
                 ON              ai.AssetId = ssr.StateStreetIdentifier
                 INNER JOIN FSFundModel_VALCOMM.Reporting.Instrument i
                 ON              ai.InstrumentId = i.InstrumentId
                 AND             ai.ExportId     = i.ExportId
                 INNER JOIN FSFundModel_VALCOMM.Reporting.Asset a
                 ON              ai.InstrumentId = a.InstrumentId
                 AND             ai.PortfolioId  = a.PortfolioId
                 AND             ai.LotId        = a.LotId
                 AND             ai.ExportId     = a.ExportId
 
 WHERE           ai.ExportId =
                 (SELECT MAX(e.ExportId)
                 FROM    FSFundModel_VALCOMM.Reporting.Export e
                 WHERE   e.FundId  = 'FSIC'
                 )
 
 AND             a.IsActiveEndOfDay = 1
 
 UNION ALL
SELECT 'VRC_AmericanEnergyCE', 'ACI06WVJ3'

--UNION ALL SELECT 'US699742AC65', '699742AC6'

UNION ALL SELECT 'VRC_Metokote', '979FWSII0'

--UNION ALL SELECT 'Priced _at_Cost', '979FWVII3'



 
 
 
 
 

GO
